<?php
namespace App\Admin\Widgets;

use Closure;
use Dcat\Admin\Widgets\Form as BaseForm;

class Form extends BaseForm
{
    /**
     * Add a fieldset to form.
     *
     * @param  string  $title
     * @param  Closure  $setCallback
     * @return Field\Fieldset
     */
    public function fieldset1(string $title, Closure $setCallback, $params = [])
    {
        $fieldset = new Fieldset();

        # 添加的
        if (isset($params['className'])) {
            $fieldset->addClassName($params['className']);
        }
    
        $this->html($fieldset->start($title))->plain();

        $setCallback($this);

        $this->html($fieldset->end())->plain();

        return $fieldset;
    }
}